#! user/bin/python
# -*- coding: utf-8 -*-

"""
Created on 2021/8/25 15:44

@File: run_any_email_script.py
@Author: LT
@Description: 运行电子邮件Package下的任意文件
"""
import os
import sys
import pprint

# ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓加上这一句就和unittest一样可以直接运行了
sys.path.append(os.path.dirname(os.path.dirname(__file__)))		# 这是顶级包所在的目录的绝对路径
# ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑

__package__ = os.path.dirname(__file__).split("\\")[-1]


# 在这下面写入正确的导入语法，就可以运行了
# test1
# from .练手_popmail_smtpmail import pop邮件阅读器脚本_popmail
# test2
# from .练手_popmail_smtpmail import smtp邮件发送器脚本_smtpmail
# test3
# from .初级_一个基于控制台的电子邮件客户端.邮件获取_发送_解析和编写的综合运用_pymail import *


# def test3():
#     popmailserver = 邮件配置模块_mailconfig.popservername
#     popmailuser = 邮件配置模块_mailconfig.popusername
#     mailfile = 邮件配置模块_mailconfig.savemailfile
#     mailpswd = 邮件配置模块_mailconfig.qq_pop_smtp_authorized_code
#     print('[Pymail email client]')
#     msgList = loadmessages(popmailserver, popmailuser, mailpswd)
#     toDelete = interact(msgList, mailfile)
#     if toDelete:
#         deletemessage(popmailserver, popmailuser, mailpswd, toDelete)
#     print('Bye~')


# def test4():
#     from . import 邮件配置模块_mailconfig
#     print('config:', 邮件配置模块_mailconfig.__file__)
#     # 从__init__中获取，因为包的话会先执行__init__.py
#     from .初级2_复写作者封装的mailtools工具包 import selftest


def test5():
    from .初级_一个基于控制台的电子邮件客户端 import 使用初级2中的mailtools工具包的_pymail2 as kk
    kk.main()


if __name__ == '__main__':
    # test3()
    # test4()
    test5()
